package com.ctgu.computer.mapper;

import com.ctgu.computer.domain.dto.AdminLoginDTO;
import com.ctgu.computer.domain.dto.UserLoginDTO;
import com.ctgu.computer.domain.po.AdminInfo;
import com.ctgu.computer.domain.po.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LoginMapper {

    @Select("select * from user_info where user_name = #{userName} and password = #{password}")
    UserInfo login(UserLoginDTO userLoginDTO);

    @Select("select * from admin_info where admin_name = #{adminName} and password = #{password}")
    AdminInfo loginA(AdminLoginDTO adminLoginDTO);

    void insert(UserInfo userInfo);

    @Select("select * from user_info where user_name = #{userName} ")
    UserInfo selectByUserName(String userName);

    @Select("select * from admin_info where admin_name = #{adminName}")
    AdminInfo selectByAdminName(String adminName);

    void insertAdmin(AdminInfo adminInfo);
}
